package com.ylfstu.homework;

import java.util.Arrays;
import java.util.Locale;

public class Homework03 {
    public static void main(String[] args) {
        String name = "Yang Ling Fei";
        String[] names = name.split(" ");
        System.out.println(Arrays.toString(names));

        String middle = names[1];
        char[] chars = middle.toCharArray();
        System.out.println(names[2] + "," + names[0] + "." + chars[0]);

        System.out.println(String.format("%s,%s.%c", names[2], names[0], names[1].toUpperCase().charAt(0)));
    }
}
